package com.junci.mtest.model.http;




import com.junci.mtest.model.Constants;

import retrofit2.Retrofit;

import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * 尼莫
 * 这是~
 */
public class MyInterfaceRetrofit {
    private static Retrofit retrofit;

    public static Retrofit getRetrofit() {
        if (retrofit == null) {
            synchronized (MyInterfaceRetrofit.class) {
                if (retrofit == null) {
                    retrofit = new Retrofit.Builder()
                            .baseUrl(Constants.BASE_URL)//Constants.BASE_URL
                            .addConverterFactory(GsonConverterFactory.create())
                            .addCallAdapterFactory(RxJava3CallAdapterFactory.create())
                            .client(HttpClient.defaultOkHttpClient())
                            .build();
                }
            }
        }
        return retrofit;
    }
}
